package org.generator.constant;

import java.io.IOException;
import java.util.Properties;

/**
 * @author yun
 * @Description
 * @since 2021-12-05
 */
public class SystemConstant {

    private static Properties properties = new Properties();

    public static String tableName;
    public static String entityName;
    public static String packageNamePre;
    public static String outUrl;
    public static String databaseName;
    public static String ipName;
    public static String portName;
    public static String userName;
    public static String passWord;
    public static String authorName;
    public static String primaryId;
    public static String moduleName;
    public static String url;

    public static void loadConfigFile(String configPath) {
        try {
            // 加载上传文件设置参数：配置文件
            properties.load(SystemConstant.class.getClassLoader().getResourceAsStream(configPath));
        } catch (IOException e) {
            e.printStackTrace();
        }
        tableName = properties.getProperty("tableName");
        entityName = properties.getProperty("entityName");
        packageNamePre = properties.getProperty("packageNamePre");
        outUrl = properties.getProperty("outUrl");
        databaseName = properties.getProperty("databaseName");
        ipName = properties.getProperty("ipName");
        portName = properties.getProperty("portName");
        userName = properties.getProperty("userName");
        passWord = properties.getProperty("passWord");
        authorName = properties.getProperty("authorName");
        primaryId = properties.getProperty("primaryId");

        moduleName = properties.getProperty("moduleName");
        url = properties.getProperty("url");
    }


}
